package database

import (
	"fmt"
	"log"
)

func HealthCheck() error {
	if DB == nil {
		return fmt.Errorf("database not initialized")
	}

	if err := DB.Raw("SELECT 1").Error; err != nil {
		return fmt.Errorf("database health check failed: %w", err)
	}

	log.Println("Database health check passed")
	return nil
}
